<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
	<p:panel id="panel" isible="true" header="Cadastro de FUncionario"
		style="width:800;">

		<p:growl>
			<h:form id="msn">
				<p:messages id="msgs" />
			</h:form>
		</p:growl>
		<h:form id="frm">

			<h:panelGrid columns="3">
				<h:panelGrid>
					<h:outputText value="ID" />
					<p:inputText value="#{funcionarioBean.funcionario.id}"
						required="true" requiredMessage="Insira um id !"></p:inputText>
				</h:panelGrid>
				<h:panelGrid>
					<h:outputText value="Nome" />
					<p:inputText value="#{funcionarioBean.funcionario.nome}"
						required="true" requiredMessage="Insira o nome !"></p:inputText>
				</h:panelGrid>
				<h:panelGrid>
					<h:outputText value="Cpf" />
					<p:inputText value="#{funcionarioBean.funcionario.cpf}"
						required="true" requiredMessage="Insira um CPF !"></p:inputText>
				</h:panelGrid>
				<h:panelGrid>
					<h:outputText value="Comissao" />
					<p:inputText value="#{funcionarioBean.funcionario.comissao}"
						required="true" requiredMessage="Insira a Comissao !"></p:inputText>
				</h:panelGrid>
				<h:panelGrid>
					<h:outputText value="Data de Inclusao" />
					<p:inputMask value="#{funcionarioBean.dataInclusao}"
						mask="99/99/9999"></p:inputMask>
				</h:panelGrid>
				<h:panelGrid>
					<h:outputText value="Status" />
					<p:inputText value="#{funcionarioBean.funcionario.status}"
						required="true" requiredMessage="Insira um Status !"></p:inputText>
				</h:panelGrid>

				<h:panelGrid>
					<h:outputText value="Setor" />


					<p:selectOneMenu value="#{funcionarioBean.funcionario.setor}"
						required="true" requiredMessage="Selecione um Setor !">
						<f:selectItems value="#{funcionarioBean.listaSetor}"></f:selectItems>
					</p:selectOneMenu>
				</h:panelGrid>
			</h:panelGrid>


			<p:dataTable id="tabela" var="fun"
				value="#{funcionarioBean.listaFuncionarios}">
				<p:column headerText="Codigo">
					<h:outputText value="#{fun.id}" />
				</p:column>

				<p:column headerText="Nome">
					<h:outputText value="#{fun.nome}" />
				</p:column>

				<p:column headerText="Setor">
					<h:outputText value="#{fun.setor}" />
				</p:column>
			</p:dataTable>

			<p:commandButton action="#{funcionarioBean.gravar}" value="Gravar"
				ajax="false" update=":msn:msgs"></p:commandButton>
			<p:commandButton action="#{funcionarioBean.atualizar}"
				value="Atualizar" update="frm tabela"></p:commandButton>
			<p:commandButton action="#{funcionarioBean.excluir}" value="Apagar"
				update="frm tabela"></p:commandButton>
			<p:commandButton action="#{funcionarioBean.concultar}"
				value="Consultar" update="frm"></p:commandButton>
			<p:commandButton action="#{funcionarioBean.listar}" value="Listar"
				update="tabela"></p:commandButton>
		</h:form>
	</p:panel>

</h:body>
</html>